<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">
    <input v-model="message"/>
    <button @click="fun_a">发送</button>
    <hr/>
    <b>接受的数据是：{{result}}</b>
</div>
</body>
</html>
<script src="js/vue.min.js"></script>
<script src="js/axios.min.js"></script>
<script>
    new Vue({
        el: '#app',
        data() {
            return {
                message: '',
                result: ''
            }
        },
        methods: {
            fun_a() {
                // 通过axios发送数据
                axios({
                    // 发送方式
                    method: 'get',
                    // 发送路径
                    url: 'first',
                    // 发送的参数GET
                    params: {
                        message: this.message // key:value
                    }
                }).then(resp => {
                    console.log(resp)
                    console.log(resp.data)
                    this.result = resp.data
                })
            }
        }
    })
</script>